<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    一,数组对象的属性
    window.name
    1.length 属性就是数组的长度,数组里面有多少个成员
    length是多少.
    数组的属性和方法的获取,通过点符号
    window.name window.alert
    注意:""," ".直接影响length
    <script>
        var arr=[1,2,3,""," "];
        console.log(arr.length);//5
    </script>


    2.length 属性可读写(获取get 设置set);
    <script>
        var arr1=[1,3,4,"",""];
        console.log(arr1);//5项
        // arr1.length=3;
        // console.log(arr1);
        arr1.length=100;
        console.log(arr1);//empty × 95
    </script>

    3.数组的索引
    通过数组的索引去获取到对应的数组项的值
    索引:下标,(通过index),是指一个数据在数组里面的排在第几个位置
    注意:在所有的语言里面,索引都是从0开始的有序的正整数.
    <script>
        var arr3=["zhhagndan","lisi","王二麻子","zhoupeiqin"];
        console.log(arr3);
        console.log(arr3[0]);
        console.log(arr3[3]);
    </script>

    4.遍历数组
    <script>
        var arr4=["zhhagndan","lisi","王二麻子","zhoupeiqin"];
        // console.log(arr4[0]);
        for(var i=0;i<arr4.length;i++){
            console.log(arr4[i]);//拿到里面的每一项
        }
    </script>
</body>
</html>